package com.google.code.jdbclogger.util;

/**
 * @author Andrey Vityuk
 */
public class TimeCounter {
    private long begin;
    private long end;

    public TimeCounter begin() {
	begin = System.currentTimeMillis();

	return this;
    }

    public TimeCounter end() {
	end = System.currentTimeMillis();

	return this;
    }

    public long get() {
	return end - begin;
    }

    @Override
    public String toString() {
	return get() + "ms";
    }
}
